﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HealthManagement.Model
{
    public class IndexInfoModel
    {
        public int TotalCount { get; set; }

        public int NormalCount { get; set; }

        public int AlarmCount { get; set; }

        public double NormalPercent
        {
            get
            {
                if (TotalCount == 0)
                    return 0;

                double val = (double)NormalCount / TotalCount;
                string str = val.ToString("F3");
                val = double.Parse(str)*100;
                return val;
            }
        }

        public string NormalPercentStr
        {
            get
            {
                return (NormalPercent/100).ToString("P1");
            }
        }

        public double AlarmPercent
        {
            get
            {
                if (TotalCount == 0)
                    return 0;

                double val = (double)AlarmCount / TotalCount;
                string str = val.ToString("F3");
                val = double.Parse(str)*100;
                return val;
            }
        }

        public string AlarmPercentStr
        {
            get
            {
                return (AlarmPercent/100).ToString("P1");
            }
        }
    }
}
